declare module Backbone {

     //interface Events { 
     //    on(event : string, callback, context? );
     //    off(event? , callback, context? );
     //    trigger(event : string, args? );    
     //}

    export class Model  {
        constructor (attr? , opts? );
        get(name: string): any;
        set(name: string, val: any): void;
        set(obj: any): void;

        id: string;
        url(): string; 

        save(attr? , opts? ): void;
        destroy( opts? ): void;
        bind(ev: string, f: Function, ctx?: any): void;
        toJSON(): any;

        fetch(opts?): any;
        fetch(attributes, options ) : void;

        attributes: any;

        on(event : string, callback, context? );
        off(event? , callback?, context? );
        trigger(event: string, args? );

    
    }

    export class Collection {
        constructor (models? , opts? );
        bind(ev: string, f: Function, ctx?: any): void;
        collection: Model;
        length: number;
        create(attrs, opts? ): Collection;
        each(f: (elem: any) => void ): void;
        fetch(opts?: any): void;
        last(): any;
        last(n: number): any[];
        filter(f: (elem: any) => any): Collection;
        without(...values: any[]): Collection;
        add(models, opts? ): void;
        url(): string; 
        toJSON(): any;

       
    }
    export class View {
        constructor (options? );
        $(selector: string): any;
        el: HTMLElement;
        $el: JQuery;
        remove(): void;
        delegateEvents(events?): void;
        make(tagName: string, attrs? , opts? ): View;
        setElement(element: HTMLElement, delegate?: bool): void;
        tagName: string;
        events: any;
        _ensureElement(): void;     
    }

     export class Router {
        constructor (options?);
    }

     export var history: any;

   

}